<?php

$a = [
    1001 => [1,2,3,4],
    1002 => [1,2,3,4],
    1003 => [1,2,3,4],
    1004 => [1,2,3,4],
];

$b = array_chunk($a, 3, true);
print_r($b);